package com.inetools.gwetons.shared.logging;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Made the below classes in order to have one central point to control/manage/customize Logger 
 * behavior since the behavior of Logger has been really not reliable on GWT. <br />
 * <ul> 
 * <li>LogUtil interface</li>
 * <li>LogUtilGinJector interface</li>
 * <li>LogUtilGinModule class</li>
 * <li>LogUtilFactoryIntf interface</li>
 * <li>LogUtilFactory enum</li>
 * </ul> 
 * This interface is for defining method signatures of Logger wrapper. At wrapping part implementation 
 * such as LogUtilGinModule class, it is possible to code desired work around for Logger issues with GWT. 
 * @author ay
 */
public interface LogUtil {
	Logger getLogger();
	String getLoggerName();
	
	void setLogger( Logger logger);
	Logger setUpLogger( String loggerName);
	
	void log( Level level, String message);
	void log( Level level, String message, Throwable throwable);
	void log( String levelStr, String message);
	
	void entering( String sourceMethod, Object[] params);
	
	/**
	 * This will be deprecated once the underneath Logger.entering method starts working as expected; 
	 * currently the Logger.entering method shows the unexpected result missing class name, method 
	 * name and parameter.
	 * @param jsArrayString: Elements of this are expected in the following order:
	 * <ul>
	 * <li>String: name of method</li>
	 * <li>String: additional message such as method arguments</li>
	 * <li>String representation of boolean to specify whether ignore the previous String element of  
	 * the additional message</li>
	 * <li>String representation of Logger.Level</li>
	 * </ul>
	 */
	@Deprecated
	void logEntering( Object... args);
	
	void exiting( String sourceMethod);
	void exiting( String sourceMethod, Object result);
	
	/**
	 * This will be deprecated once the underneath Logger.entering method starts working as expected; 
	 * currently the Logger.entering method shows the unexpected result missing class name, method 
	 * name and parameter.
	 * @param jsArrayString: Elements of this are expected in the following order:
	 * <ul>
	 * <li>String: name of method</li>
	 * <li>String representation of returned object</li>
	 * <li>String representation of boolean to specify whether ignore the previous String element for 
	 * the returned object for the returning void case</li>
	 * <li>String representation of Logger.Level</li>
	 * </ul>
	 */
	@Deprecated
	void logExiting( Object... args);
}